package com.itheima.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.pojo.CheckItem;
import com.itheima.health.service.CheckltemService;
import com.itheima.health.utils.resources.MessageConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "检查组模块管理")
public class CheckltemController {

    @Reference
    private CheckltemService checkltemService;

    //开发检查项模块
    @GetMapping("checkitem/findAll/1")
    @ApiOperation(value = "查询检查项方法",notes = "查询所有的检查项列表信息")
    public Result findAll(){
        try {
            List<CheckItem> list = checkltemService.list();
            return new Result(true,MessageConstant.QUERY_CHECKGROUP_SUCCESS,list);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false,MessageConstant.QUERY_CHECKGROUP_FAIL);
        }

    }
}
